<link rel="stylesheet" href="{{ asset('bundles/rtscraftmain/css/article.css') }}" type="text/css" media="all" />

<center>
{% if entity != null %}
<!-- The header of the element. -->
{% block introduction %}
<table width=40%>
  <tr><th colspan="2" class="entity_name">{{ entity.name }}</th></tr>
  {% for faction in entity.factions %}
  <tr>
    <!--Fixme : include image ?-->
    <td>
      <center>
	{{ faction.name }}
      </center>
    </td>
  </tr>
  {% endfor %}
</table>
{% endblock %}

<hr/>

<!-- The resources -->
{% block ressources %}
{%   for value in entity.costs %}
{%     if value != null %}

<!-- First : the list of Costs -->
  <table width=80%>
    <tr>
      <th colspan="2" class="entity_name">{{ value.name }}</th>
    </tr>
    {%     for svalue in value.prices %}
    <!-- Then : the list of prices in this cost. -->
    <tr>
      <td class="statName">{{ svalue.ressource.name }}</td>
      <td class="statValue">{{ svalue.value }}</td>
    </tr>
    {%     endfor %}
  </table>

{%     endif %}
{%   endfor %}
{% endblock %}

<hr/>

<!-- The image -->
{% block image %}
<img src={{ entity.imgURL }} alt="There is no image !"
     class="entity_img"/>
{% endblock %}

<hr/>

<!-- The statistics -->
{% block statistics %}
<table width=80%>
<tr>
  <td colspan="2" class="entity_name">Statistics </td>
<tr>
  {% for sheet in entity.sheets %}
  {%  for stat in sheet.statistics %}
  <tr class="stat">
    <td class="statName">{{ stat.name }}</td> <!-- Fixme : img -->
    <td class="statValue">{{ sheet.value }}</td>
  </tr>
  {%  endfor %}
  {% endfor %}
</table>
{% endblock %}

{% else %}

<p>
  No associated entity.
</p>

{% endif %}
</center>
